package com.base.action;

import com.base.bean.Personnelsales;
import com.base.service.PersonnelsalesService;
import com.common.util.PagerModel;
import com.core.ssh2.AbstractActionSupport;
import com.opensymphony.xwork2.Preparable;

public class PersonnelsalesManagerAction extends AbstractActionSupport
		implements Preparable {
	private static final long serialVersionUID = 3850436891848682531L;

	private PersonnelsalesService personnelsalesService;
	
	private Personnelsales personnelsales;
	
	private long personnelid;
	
	private PagerModel pm;
	
	public void prepare() throws Exception {
	}
	
	@Override
	public String execute() throws Exception {
		return SUCCESS;
	}

	public String goAddPersonnelsales() throws Exception {
		return SUCCESS;
	}
	
	public String addPersonnelsales() throws Exception {
		personnelsalesService.addPersonnelsales(personnelsales);
		return SUCCESS;
	}
	
	public String findAllPersonnelsales() throws Exception {
		pm = personnelsalesService.findPersonnelsalesForPager();
		return SUCCESS;
	}
	
	public String findPersonnelsales() throws Exception {
		personnelsales = personnelsalesService.findPersonnelsales(personnelid); 
		return SUCCESS;
	}
	
	public String delPersonnelsales() throws Exception {
		personnelsalesService.removePersonnelsales(personnelid);
		return SUCCESS;
	}
	
	public String getPersonnelsalesForUpdate() throws Exception {
		personnelsales = personnelsalesService.findPersonnelsales(personnelid); 
		return SUCCESS;
	}
	
	public String updatePersonnelsales() throws Exception {
		personnelsalesService.updatePersonnelsales(personnelsales);
		return SUCCESS;
	}

	/**
	 * @return the personnelid
	 */
	public long getPersonnelid() {
		return personnelid;
	}

	/**
	 * @param personnelid the personnelid to set
	 */
	public void setPersonnelid(long personnelid) {
		this.personnelid = personnelid;
	}

	/**
	 * @return the personnelsales
	 */
	public Personnelsales getPersonnelsales() {
		return personnelsales;
	}

	/**
	 * @param personnelsales the personnelsales to set
	 */
	public void setPersonnelsales(Personnelsales personnelsales) {
		this.personnelsales = personnelsales;
	}

	/**
	 * @return the personnelsalesService
	 */
	public PersonnelsalesService getPersonnelsalesService() {
		return personnelsalesService;
	}

	/**
	 * @param personnelsalesService the personnelsalesService to set
	 */
	public void setPersonnelsalesService(PersonnelsalesService personnelsalesService) {
		this.personnelsalesService = personnelsalesService;
	}

	/**
	 * @return the pm
	 */
	public PagerModel getPm() {
		return pm;
	}

	/**
	 * @param pm the pm to set
	 */
	public void setPm(PagerModel pm) {
		this.pm = pm;
	}
	
}
